//
//  NetworkTool.m
//  DaiShengInvest
//
//  Created by 张睿 on 2017/7/12.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "NetworkTool.h"

@implementation NetworkTool

+(instancetype)sharedTools{
    
    static NetworkTool *instance;
    static dispatch_once_t onceToken;
    
    dispatch_once(&onceToken, ^{
        //基本的地址
        NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
        
        NSURL *url = [NSURL URLWithString:BASEURLSTR];
        
        instance = [[NetworkTool alloc] initWithBaseURL:url sessionConfiguration:config];
        
        //设置超时时间
        config.timeoutIntervalForRequest = 10;
       
        instance.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json",@"text/json",@"text/javascript",@"text/html", @"image/jpeg",@"image/png", @"application/octet-stream", nil];
        instance.requestSerializer = [AFHTTPRequestSerializer serializer];

        
    });
    return instance;
}



@end
